Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace DynConnector and HttpConnector with HttpClient #3011

Merged
merged 28 commits into from
Oct 6, 2023

Conversation

jdisanti
Copy link
Collaborator

@jdisanti jdisanti commented Sep 29, 2023

This PR removes the last usages of DynConnector and HttpConnector from the aws_smithy_client crate with their counterparts in aws-smithy-runtime-api and aws-smithy-runtime. It also introduces HttpClient to make HTTP connector selection a smoother process, and adds a runtime plugin that configures a default HttpClient so that Config doesn't have to do that.

The DnsService from aws-config is also moved into aws-smithy-runtime and refactored to be consistent with the other configurable traits in the orchestrator since it will likely be used in the future for more than just the ECS credentials provider.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@github-actions
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

Base automatically changed from jdisanti-aws-config-direct-invoke to main September 29, 2023 01:31
This PR removes the last usages of `DynConnector` and `HttpClient` from
the `aws_smithy_client` crate.
@jdisanti jdisanti force-pushed the jdisanti-connector-switchover branch from abbc13d to 0af7920 Compare September 29, 2023 23:34
@jdisanti
Copy link
Collaborator Author

jdisanti commented Oct 3, 2023

I still need to write changelog entries and apply the breaking-change label, but otherwise, this should be ready for an initial round of review.

@jdisanti jdisanti marked this pull request as ready for review October 3, 2023 00:33
@jdisanti jdisanti requested review from a team as code owners October 3, 2023 00:33
@smithy-lang smithy-lang deleted a comment from github-actions bot Oct 3, 2023
@smithy-lang smithy-lang deleted a comment from github-actions bot Oct 3, 2023
@smithy-lang smithy-lang deleted a comment from github-actions bot Oct 3, 2023
@smithy-lang smithy-lang deleted a comment from github-actions bot Oct 3, 2023
@smithy-lang smithy-lang deleted a comment from github-actions bot Oct 4, 2023
@github-actions
Copy link

github-actions bot commented Oct 4, 2023

A new generated diff is ready to view.

A new doc preview is ready to view.

@jdisanti jdisanti added the breaking-change This will require a breaking change label Oct 4, 2023
@smithy-lang smithy-lang deleted a comment from github-actions bot Oct 4, 2023
@jdisanti
Copy link
Collaborator Author

jdisanti commented Oct 4, 2023

The changelog entries and upgrade guidance are now in place. I think I incorporated all the feedback above, or explained why I'm punting on it.

@github-actions
Copy link

github-actions bot commented Oct 4, 2023

A new generated diff is ready to view.

A new doc preview is ready to view.

Copy link
Contributor

@Velfi Velfi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed the new changes. It still looks good to me.

Copy link
Collaborator

@rcoh rcoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

effectively lgtm, but I expect that there will be one more pass

aws/rust-runtime/aws-credential-types/external-types.toml Outdated Show resolved Hide resolved
aws/rust-runtime/aws-inlineable/src/endpoint_discovery.rs Outdated Show resolved Hide resolved
aws/sdk/integration-tests/webassembly/src/http.rs Outdated Show resolved Hide resolved
examples/pokemon-service-common/src/lib.rs Show resolved Hide resolved
{
fn http_connector(
&self,
settings: &HttpConnectorSettings,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should add derive(Hash) to settings to make this cleaner

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was worried that could tie our hands in some way.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this structure has to be Hash if we expect people to use it as a cache key

rust-runtime/aws-smithy-runtime/src/client/http.rs Outdated Show resolved Hide resolved
Comment on lines +365 to +371
let settings = {
let mut builder = HttpConnectorSettings::builder();
builder.set_connect_timeout(timeout_config.connect_timeout());
builder.set_read_timeout(timeout_config.read_timeout());
builder.build()
};
let connector = http_client.http_connector(&settings, runtime_components);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

operation-level timeouts didn't work before this right? Seems like we should add an integration test to capture that if we didn't already

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know what gave you the impression operation timeouts weren't working. We have integration tests for all the varieties of timeouts: https://github.com/awslabs/smithy-rs/blob/0af7920eba8d8d0dac79035c862e1dde1b377afc/aws/sdk/integration-tests/s3/tests/timeouts.rs

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

none of those tests change the HTTP connector timeouts for an individual operation (and I don't think we possibly could have supported that because we didn't have a cache keyed on http configuration)

mod async_impls {
use aws_smithy_async::rt::sleep::{AsyncSleep, SharedAsyncSleep};
use aws_smithy_async::time::{SharedTimeSource, TimeSource};
impl_shared_conversions!(convert SharedAsyncSleep from AsyncSleep using SharedAsyncSleep::new);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

side note: we should rename the new methods to be something like new_from_unshared so they don't get called by accident and we have a place to guide folks to the into_shared() method

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I'm not understanding your concern correctly, but I don't think I agree.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you call SharedAsyncSleep::new and pass it something that's already a SharedAsyncSleep, you won't take advantage of the magic, right?

Copy link
Contributor

@ysaito1001 ysaito1001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A fantastic piece of work, including docs and the upgrade guide ❤️ (for aws-smithy-runtime/src/client/http/test_util/* I only skimmed through them)

@github-actions
Copy link

github-actions bot commented Oct 5, 2023

A new generated diff is ready to view.

A new doc preview is ready to view.

@github-actions
Copy link

github-actions bot commented Oct 5, 2023

A new generated diff is ready to view.

A new doc preview is ready to view.

@github-actions
Copy link

github-actions bot commented Oct 6, 2023

A new generated diff is ready to view.

A new doc preview is ready to view.

@jdisanti jdisanti added this pull request to the merge queue Oct 6, 2023
Merged via the queue into main with commit 26a914e Oct 6, 2023
40 of 41 checks passed
@jdisanti jdisanti deleted the jdisanti-connector-switchover branch October 6, 2023 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change This will require a breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants